<me:UIGLLG x:Class="WPFExcelReport.TCPGB"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"   
                    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                    xmlns:me="clr-namespace:WPFExcelReport"  
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                   x:Name="TV"
                    Background="White"    
                    Loaded="Window_Loaded"
     >
    <me:UIGLLG.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
        <ucd:TRIMGB2312Convert8859P1 x:Key="tgb"/>
    </me:UIGLLG.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" >
            <WrapPanel >
                <Label Content="{Binding Source={Localization:Translate Word=日期}}" Margin="0,0,0,0"  HorizontalAlignment="Left"   FontSize="16" Width="45" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0"  FontSize="16" Name="DT"  Panel.ZIndex="1"  
                             IsEnabled="{Binding IsEdit,ElementName=TV}" SelectedDateChanged ="FROM_DATE_SelectedDateChanged"  Width="134" />
                <Button Content="{Binding Source={Localization:Translate Word=日期多行修改}}" Height="33" Margin="0,0,0,0"  FontSize="14" Width="85" Panel.ZIndex="2"
                        Click="DT2ALLCommand" />
                <TextBox Name="txtDAT" IsReadOnly="True" Text="{Binding ICCDAT,Source={StaticResource ResourceKey=vwMaster}}" Visibility="Collapsed" Width="80"/>
                <Label Content="{Binding Source={Localization:Translate Word=包数}}"  Width="43" Margin="0,0,0,0"  HorizontalAlignment="Left"   FontSize="16" />
                <TextBox Name="txtBOX" Width="58" Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="3"
                         IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" CharacterCasing="Upper" FontSize="18" Height="33"
                         Text="{Binding GLBSTKA,Source={StaticResource ResourceKey=vwMaster}}"/>
                <Label Content="{Binding Source={Localization:Translate Word=重量}}"  Width="Auto" Margin="0,0,0,0"     FontSize="18" />
                <TextBox Margin="0,0,0,0"  HorizontalAlignment="Left" Background="Yellow"  FontSize="18" Panel.ZIndex="4"
                         IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" CharacterCasing="Upper"   Width="91" 
                         Text="{Binding GLBSTKG,Source={StaticResource ResourceKey=vwMaster},Converter={StaticResource d1000}}"/>
                <Button Content="{Binding Source={Localization:Translate Word=修改}}" Height="33" Margin="10,0,0,0"  FontSize="18" Width="48" Panel.ZIndex="5"
                        Click="EditCommand" />
                <Button     Content="{Binding Source={Localization:Translate Word=保存}}"  Margin="10,0,0,0" Width="50" FontSize="18" Panel.ZIndex="6"
                            IsEnabled="{Binding IsEdit,ElementName=TV}" Click="SaveCommand"
                     />
            </WrapPanel>
        </StackPanel>

        <DataGrid  Grid.Row="1" Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"
                   Name="dlgMaster" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                    >
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                    <DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                        </DataTemplate>
                    </DataGridCheckBoxColumn.HeaderTemplate>
                </DataGridCheckBoxColumn>
                <!--ICCDAT,GLPARTIE,GLLO,GLLB,GLLBEHI,GLBSTKG,GLBSTKA,GLBSTSP,GLBEM,GLFILLER1-->
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=类型}}" Binding="{Binding TYP,Converter={StaticResource ResourceKey=tgb}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=库}}" Binding="{Binding GLLO}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=库区}}" Binding="{Binding GLLB}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=日期}}"   Binding="{Binding ICCDAT}"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=入库号}}" Binding="{Binding GLPARTIE}" IsReadOnly="True"/>
                <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=箱号}}" Binding="{Binding GLLBEHI}" IsReadOnly="True"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=重量}}" Binding="{Binding GLBSTKG,Converter={StaticResource ResourceKey=d1000}}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=包数}}" Binding="{Binding GLBSTKA}" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=修改用户/日期}}" Binding="{Binding GLFILLER1,Converter={StaticResource ResourceKey=trim}}" IsReadOnly="True" Width="Auto"/>
                <DataGridTextColumn Header="{Binding Source={Localization:Translate Word=打包方式}}" Binding="{Binding GLBEM,Converter={StaticResource ResourceKey=tgb}}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
        <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
    </Grid>

</me:UIGLLG>
